<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template time_zone_base</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../date_time/doxy.html#header.boost.date_time.time_zone_base_hpp" title="Header &lt;boost/date_time/time_zone_base.hpp&gt;">
<link rel="prev" href="dst_adjustment_offsets.html" title="Class template dst_adjustment_offsets">
<link rel="next" href="default_zone_names.html" title="Struct template default_zone_names">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="dst_adjustment_offsets.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../date_time/doxy.html#header.boost.date_time.time_zone_base_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="default_zone_names.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.date_time.time_zone_base"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template time_zone_base</span></h2>
<p>boost::date_time::time_zone_base — Interface class for dynamic time zones. </p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../date_time/doxy.html#header.boost.date_time.time_zone_base_hpp" title="Header &lt;boost/date_time/time_zone_base.hpp&gt;">boost/date_time/time_zone_base.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> time_type<span class="special">,</span> <span class="keyword">typename</span> CharT<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="time_zone_base.html" title="Class template time_zone_base">time_zone_base</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">CharT</span>                             <a name="boost.date_time.time_zone_base.char_type"></a><span class="identifier">char_type</span><span class="special">;</span>         
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special">&lt;</span> <span class="identifier">CharT</span> <span class="special">&gt;</span>        <a name="boost.date_time.time_zone_base.string_type"></a><span class="identifier">string_type</span><span class="special">;</span>       
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostringstream</span><span class="special">&lt;</span> <span class="identifier">CharT</span> <span class="special">&gt;</span> <a name="boost.date_time.time_zone_base.stringstream_type"></a><span class="identifier">stringstream_type</span><span class="special">;</span> 
  <span class="keyword">typedef</span> <span class="identifier">time_type</span><span class="special">::</span><span class="identifier">date_type</span><span class="special">::</span><span class="identifier">year_type</span>   <a name="boost.date_time.time_zone_base.year_type"></a><span class="identifier">year_type</span><span class="special">;</span>         
  <span class="keyword">typedef</span> <span class="identifier">time_type</span><span class="special">::</span><span class="identifier">time_duration_type</span>     <a name="boost.date_time.time_zone_base.time_duration_type"></a><span class="identifier">time_duration_type</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="time_zone_base.html#boost.date_time.time_zone_baseconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="time_zone_base.html#id-1_3_12_15_3_56_1_1_2_10-bb"><span class="identifier">time_zone_base</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">virtual</span> <a class="link" href="time_zone_base.html#id-1_3_12_15_3_56_1_1_2_11-bb"><span class="special">~</span><span class="identifier">time_zone_base</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="time_zone_base.html#id-1_3_12_15_3_56_1_1_2_9-bb">public member functions</a></span>
  <span class="keyword">virtual</span> <span class="identifier">string_type</span> <a class="link" href="time_zone_base.html#id-1_3_12_15_3_56_1_1_2_9_1-bb"><span class="identifier">dst_zone_abbrev</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="identifier">string_type</span> <a class="link" href="time_zone_base.html#id-1_3_12_15_3_56_1_1_2_9_2-bb"><span class="identifier">std_zone_abbrev</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="identifier">string_type</span> <a class="link" href="time_zone_base.html#id-1_3_12_15_3_56_1_1_2_9_3-bb"><span class="identifier">dst_zone_name</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="identifier">string_type</span> <a class="link" href="time_zone_base.html#id-1_3_12_15_3_56_1_1_2_9_4-bb"><span class="identifier">std_zone_name</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">bool</span> <a class="link" href="time_zone_base.html#id-1_3_12_15_3_56_1_1_2_9_5-bb"><span class="identifier">has_dst</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="identifier">time_type</span> <a class="link" href="time_zone_base.html#id-1_3_12_15_3_56_1_1_2_9_6-bb"><span class="identifier">dst_local_start_time</span></a><span class="special">(</span><span class="identifier">year_type</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="identifier">time_type</span> <a class="link" href="time_zone_base.html#id-1_3_12_15_3_56_1_1_2_9_7-bb"><span class="identifier">dst_local_end_time</span></a><span class="special">(</span><span class="identifier">year_type</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="identifier">time_duration_type</span> <a class="link" href="time_zone_base.html#id-1_3_12_15_3_56_1_1_2_9_8-bb"><span class="identifier">base_utc_offset</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="identifier">time_duration_type</span> <a class="link" href="time_zone_base.html#id-1_3_12_15_3_56_1_1_2_9_9-bb"><span class="identifier">dst_offset</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="identifier">string_type</span> <a class="link" href="time_zone_base.html#id-1_3_12_15_3_56_1_1_2_9_10-bb"><span class="identifier">to_posix_string</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.12.15.3.55.4.4"></a><h2>Description</h2>
<p>This class represents the base interface for all timezone representations. Subclasses may provide different systems for identifying a particular zone. For example some may provide a geographical based zone construction while others may specify the offset from GMT. Another possible implementation would be to convert from POSIX timezone strings. Regardless of the construction technique, this is the interface that these time zone types must provide.</p>
<p>Note that this class is intended to be used as a shared resource (hence the derivation from boost::counted_base. </p>
<div class="refsect2">
<a name="id-1.3.12.15.3.55.4.4.4"></a><h3>
<a name="boost.date_time.time_zone_baseconstruct-copy-destruct"></a><code class="computeroutput">time_zone_base</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="id-1_3_12_15_3_56_1_1_2_10-bb"></a><span class="identifier">time_zone_base</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">virtual</span> <a name="id-1_3_12_15_3_56_1_1_2_11-bb"></a><span class="special">~</span><span class="identifier">time_zone_base</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.12.15.3.55.4.4.5"></a><h3>
<a name="id-1_3_12_15_3_56_1_1_2_9-bb"></a><code class="computeroutput">time_zone_base</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">string_type</span> <a name="id-1_3_12_15_3_56_1_1_2_9_1-bb"></a><span class="identifier">dst_zone_abbrev</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>String for the timezone when in daylight savings (eg: EDT) </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">string_type</span> <a name="id-1_3_12_15_3_56_1_1_2_9_2-bb"></a><span class="identifier">std_zone_abbrev</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>String for the zone when not in daylight savings (eg: EST) </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">string_type</span> <a name="id-1_3_12_15_3_56_1_1_2_9_3-bb"></a><span class="identifier">dst_zone_name</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>String for the timezone when in daylight savings (eg: Eastern Daylight Time) </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">string_type</span> <a name="id-1_3_12_15_3_56_1_1_2_9_4-bb"></a><span class="identifier">std_zone_name</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>String for the zone when not in daylight savings (eg: Eastern Standard Time) </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">bool</span> <a name="id-1_3_12_15_3_56_1_1_2_9_5-bb"></a><span class="identifier">has_dst</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>True if zone uses daylight savings adjustments otherwise false. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">time_type</span> <a name="id-1_3_12_15_3_56_1_1_2_9_6-bb"></a><span class="identifier">dst_local_start_time</span><span class="special">(</span><span class="identifier">year_type</span> y<span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>Local time that DST starts – undefined if has_dst is false. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">time_type</span> <a name="id-1_3_12_15_3_56_1_1_2_9_7-bb"></a><span class="identifier">dst_local_end_time</span><span class="special">(</span><span class="identifier">year_type</span> y<span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>Local time that DST ends – undefined if has_dst is false. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">time_duration_type</span> <a name="id-1_3_12_15_3_56_1_1_2_9_8-bb"></a><span class="identifier">base_utc_offset</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>Base offset from UTC for zone (eg: -07:30:00) </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">time_duration_type</span> <a name="id-1_3_12_15_3_56_1_1_2_9_9-bb"></a><span class="identifier">dst_offset</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>Adjustment forward or back made while DST is in effect. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">string_type</span> <a name="id-1_3_12_15_3_56_1_1_2_9_10-bb"></a><span class="identifier">to_posix_string</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>Returns a POSIX time_zone string for this object. </li>
</ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2001-2005 CrystalClear Software, Inc<p>Subject to the Boost Software License, Version 1.0. (See accompanying file
    <code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="dst_adjustment_offsets.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../date_time/doxy.html#header.boost.date_time.time_zone_base_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="default_zone_names.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
